package com.itheima.day10;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

/*
双色球
代码生成5000双色球注彩票
6+1
1-33 选6个号  蓝色
1-16  红色

1_ 5000注不允许重复
2_ 蓝色球 连号最多出现连三，连四及以上不允许出现
3_ 统计5000个号中号码10,20,30分别出现的次数
4_ 5000个号码中，哪个号码出现的次数最多？
 */
public class Test03 {

    public static void main(String[] args) {
        Random r = new Random();

        ArrayList<Integer> redlist = new ArrayList<>();
        for (int i = 1; i <=33; i++) {
            redlist.add(i);
        }
        ArrayList<Integer> bluelist = new ArrayList<>();
        for (int i = 1; i <=16; i++) {
            redlist.add(i);
        }
        ArrayList<Integer> redBalls = new ArrayList<>();
        for (int i = 0; i < 6; i++) {
            int index = r.nextInt(redlist.size());
            Integer red = redlist.get(index);
            redlist.remove(index);
            redBalls.add(red);
        }
        Collections.sort(redBalls);
        int blueball = r.nextInt(16);
        System.out.println("红球"+redBalls);
        System.out.println("篮球"+blueball);

    }



}
